package com.ml.mall.service.variant;

import com.ml.mall.bean.page.Page;
import com.ml.mall.bean.req.product.*;
import com.ml.mall.bean.req.variant.*;
import com.ml.mall.bean.res.product.SysProductQueryByRandomWith18Res;
import com.ml.mall.bean.res.product.SysProductShopPageRes;
import com.ml.mall.bean.res.product.SysProductVariants;
import com.ml.mall.bean.res.variant.SysProductVariantQueryAllRes;
import com.ml.mall.bean.res.variant.SysProductVariantQueryCartRes;
import com.ml.mall.bean.res.variant.SysProductVariantQueryOneRes;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ml.mall.bean.vo.variant.VariantDetailVO;
import com.ml.mall.entity.variant.SysProductVariant;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
* <p>
    *  服务类
    * </p>
*
* @author kyyang
* Created 2021-05-15
*/
public interface SysProductVariantService extends IService<SysProductVariant> {
    //查询某一个时间之前的售价
    SysProductVariant sysTimeBeforeMoney(String timeEnd,Long variantId );

    //通过variantId 查询图片；卖家名称；变体名称
    VariantDetailVO sysProductVariantQueryRele(Long variantId);

    /**
     * @description: 实际产品新增
     * @author kyyang
     * @date 2021/5/17 22:34
     * @version 1.0
     */
    int sysProductVariantNew(VariantNewReq req);

    /**
     * @description: 实际产品编辑
     * @author kyyang
     * @date 2021/5/17 22:35
     * @version 1.0
     */
    int sysProductVariantEdit(VariantEditReq req);

    /**
     * @description: 实际产品删除
     * @author kyyang
     * @date 2021/5/17 22:35
     * @version 1.0
     */
    int sysProductVariantDel(List<Long> ids);

    /**
     * @description: 查询实际产品详情
     * @author kyyang
     * @date 2021/5/18 20:52
     * @version 1.0
     */
    SysProductVariantQueryOneRes sysProductVariantByQueryOne(VariantQueryOneReq variantQueryOneReq);

    /**
     * @description: 根据产品编号查询所有sku
     * @author kyyang
     * @date 2021/5/19 21:41
     * @version 1.0
     */
    List<SysProductVariantQueryAllRes> sysProductVariantQueryAll(VariantQueryAllReq variantQueryAllReq);

    /**
     * @description: sku 限时价格销售 新增
     * @author kyyang
     * @date 2021/5/20 20:42
     * @version 1.0
     */
    int sysProductVariantSalesNew(VariantSalesNewReq req);

    /**
     * @description: sku 限时价格销售 编辑
     * @author kyyang
     * @date 2021/5/22 14:20
     * @version 1.0
     */
    int sysProductVariantSalesEdit(VariantSalesEditReq req);

    /**
     * @description: 根据sku 编号查询当前产品单价
     * @author kyyang
     * @date 2021/5/27 20:46
     * @version 1.0
     */
    BigDecimal findSkuPriceByVariantId(Long variantId);

    /**
     * @description: 根据关键词和州属进行产品查询
     * @author pl
     * @date 2021/6/28
     * @version 1.0
     */
    Page<SysProductShopPageRes> sysProductQueryByKeywordAndStates(ShopQueryPageByKeyWord dto);

    /**
     * @description: 根据categoryId进行产品查询
     * @author pl
     * @date 2021/6/30
     * @version 1.0
     */
    Page<SysProductShopPageRes> sysProductQueryPageByCategoryId(ShopQueryPageByCategoryIdDto dto);

    /**
     * @description: 随机选取18条数据进行产品查询
     * @author pl
     * @date 2021/7/1
     * @version 1.0
     */
    List<SysProductQueryByRandomWith18Res> sysProductQueryByRandomWith18(QueryRandom18Dto dto);

    /**
     * @description: 根据variantId对单个产品详细信息进行查询
     * @author pl
     * @date 2021/7/1
     * @version 1.0
     */
    SysProductVariants sysProductQueryOneByVariantId(VariantIdDto dto);

    /**
     * @description: 根据supplierId查询卖家下的产品信息
     * @author pl
     * @date 2021/7/1
     * @version 1.0
     */
    Page<SysProductShopPageRes> sysProductQueryPageBySupplierId(ShopQueryPageBySupplierIdDto dto);

    /**
     * @description: 根据variantId查询同一子目录产品，并随机返回12个
     * @author pl
     * @date 2021/7/1
     * @version 1.0
     */
    List<SysProductShopPageRes> sysProductQueryRandom12ByVariantId(SysVariantIdDto dto);

    /**
     * @description: 根据variantId修改实体的状态
     * @author zz
     * @date 2021/8/24
     * @version 1.0
     */
    int sysProductVariantStateEdit(VariantStateEditReq req);

    SysProductVariantQueryCartRes getSysProductVariant(Long id);

    List<SysProductShopPageRes> sortByPrice(List<SysProductShopPageRes> list,Integer type);
}
